package com.android.Android_tp1;

import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.List;

import org.jdom.*;
import org.jdom.input.SAXBuilder;


public class questionnaire {
	
	 Element listeQuestions = new Element("listeQuestions");
	 org.jdom.Document document = new Document(listeQuestions);
	 Element questions = new Element("Question");
	 Element id = new Element("ID");
	 SAXBuilder sxb = new SAXBuilder();
	 
	 
	 public questionnaire(InputStream nom) {
		try {
			document = sxb.build(nom);
		} catch (JDOMException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
	}

	void rechercherQuestions (){
		boolean trouve = false;
		List lQuestions = listeQuestions.getChildren("Question");
		Iterator i = lQuestions.iterator();
		while (i.hasNext() && trouve){
			Element courant = (Element)i.next();
			courant.getAttributeValue("ID");
		}
	}
	 
	 
   


	/*public Element getQuestions(Element id) {
		
	}*/


	public void setQuestions(Element questions) {
		this.questions = questions;
	}


	public Element getListeQuestions() {
		return listeQuestions;
	}


	public void setListeQuestions(Element listeQuestions) {
		this.listeQuestions = listeQuestions;
	}


	public org.jdom.Document getDocument() {
		return document;
	}


	public void setDocument(org.jdom.Document document) {
		this.document = document;
	}
   	
	
	
}
